<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="layout :: common_header(~{::title})">
    <title>订单商品查询 - WMS仓库管理系统</title>
</head>
<body th:replace="layout :: common_body(~{::div.layui-body})">

<div class="layui-body" style="padding:15px;top: 0px;">
    <style type="text/css">
        .T-box {
            width: 400px;
            padding: 0 20px;
            text-align: left;
        }

        .T-box p {
            position: relative;
            height: 36px;
            line-height: 36px;
            font-size: 14px;
            margin-bottom: 15px;
        }

        .T-box p span {
            display: inline-block;
            padding-right: 15px;
            text-align: right;
            width: 110px;
            line-height: 36px;
            font-size: 14px;
        }

        .T-box p input, .T-box p select {
            width: 160px;
            padding: 0 5px;
            height: 34px;
            line-height: 34px;
            font-size: 14px;
            border: 1px solid #d3d3d3;
            outline: none;
        }

        .T-box p i {
            padding: 0 10px;
            line-height: 36px;
            font-style: normal;
        }

        .T-box p b {
            display: inline-block;
            margin-left: 10px;
            cursor: pointer;
            width: 60px;
            height: 36px;
            line-height: 36px;
            background: #c33;
            color: #fff;
            text-align: center;
            font-size: 13px;
            font-weight: normal;
        }

        .T-result {
            margin-bottom: 0;
        }

        .T-result em {
            color: #c33;
            font-style: normal;
        }
        .red{
            color: red;
        }
    </style>
    <!-- start sp-wrapper -->
    <fieldset class="layui-elem-field">
        <legend>按条件搜索</legend>
        <div class="layui-field-box">
            <form class="layui-form layui-form-pane1" method="get" th:action="${searchUrl}">
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <input type="text" name="orderNum" th:value="${orderNum}" placeholder="订单编号" class="layui-input" style="width: 220px;">
                    </div>
                    <div class="layui-inline">
                        <input type="text" name="skuNum" th:value="${skuNum}" placeholder="商品SKU" class="layui-input">
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">下单时间</label>
                        <div class="layui-input-inline">
                            <input type="text" class="layui-input" name="startTime" id="startTime" placeholder="yyyy-MM-dd" th:value="${startTime}" autocomplete="off">
                        </div>
                        <div class="layui-input-inline">
                            <input type="text" class="layui-input" name="endTime" id="endTime" placeholder="yyyy-MM-dd" th:text="${endTime}" autocomplete="off">
                        </div>
                    </div>

                    <div class="layui-inline">
                        <button type="submit" class="layui-btn">搜索</button>
                        <i>总共：&nbsp;[[${totalSize}]]&nbsp;条记录</i>
                    </div>
                    <div class="layui-inline" th:if="${status!=null && status == 4}">
                        <a class="layui-btn layui-btn-primary" href="javascript:;" id="export_order">导出excel</a>
                    </div>



                </div>
            </form>



        </div>
    </fieldset>

    <link rel="stylesheet" href="/sb/stock.css"/>
    <div class="sp-wrapper">
        <div class="sp-table">
            <table>
                <thead>
                <tr>
                    <th>Item Id</th>
                    <th>订单编号</th>
                    <th>商品</th>
                    <th>商品编码</th>
                    <th>SKU编码</th>
                    <th>规格</th>
                    <th>数量</th>
                    <th>下单时间</th>
                    <th>发货批次号</th>
                    <th>订单状态</th>
                </tr>
                </thead>
                <tbody id="sp-data">
                <tr th:each="item:${list}">
                    <td th:text="${item.id}">1</td>
                    <td><b th:text="${item.orderNum}"></b></td>
                    <td>
                        <img th:src="${item.goodsImg}" style="width: 50px;height: 50px;" />
                    </td>
                    <td><b th:text="${item.productNumber}"></b></td>
                    <td><b th:text="${item.skuNumber}"></b></td>
                    <td>
                        <b th:text="${item.colorValue}"></b>  <span th:text="${item.sizeValue}"></span>
                    </td>

                    <td><b th:text="${item.quantity}"></b></td>
                    <td>
                        <b th:text="${#dates.format(item.orderTime * 1000,'yyyy-MM-dd HH:mm:ss')}"></b>
                    </td>
                    <td th:text=${item.stockInfoItemId}></td>
                    <td >
                       <b th:text="${T(com.b2c.wms.enums.EnumErpOrderSendStatus).getName(item.orderStatus)}"></b>
                        <!-- <b th:class="${item.orderStatus == 0 ? 'red': ''}" th:text="${item.orderStatus}"></b> -->
                    </td>
                </tr>
                </tbody>
            </table>
            <div class="pages">
                <paging:pager th:value="${pageIndex}" th:rows="${totalSize}" th:size="${pageSize}"/>
            </div>
        </div>
    </div>



    <script type="text/javascript" src="/static/sb/jquery.min.js"></script>
    <script type="text/javascript" src="/static/sb/Tips.min.js"></script>
    <script type="text/javascript">
        function getDateTime(timestamp) {
            var date = new Date(timestamp); //时间戳为10位需*1000，时间戳为13位的话不需乘1000
            var Y = date.getFullYear();
            var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1);
            var D = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate());
            var h = (date.getHours() < 10 ? '0' + (date.getHours()) : date.getHours());
            var m = (date.getMinutes() < 10 ? '0' + (date.getMinutes()) : date.getMinutes());
            var s = (date.getSeconds() < 10 ? '0' + (date.getSeconds()) : date.getSeconds());
            return Y + '-' + M + '-' + D + ' ' + h + ':' + m + ':' + s;
        }
        //计算天数差的函数，通用
        function DateDiff(sDate1, sDate2) { //sDate1和sDate2是2019-3-12格式
            var aDate, oDate1, oDate2, iDays
            aDate = sDate1.split("-")
            oDate1 = new Date(aDate[1] + '-' + aDate[2] + '-' + aDate[0]) //转换为9-25-2017格式
            aDate = sDate2.split("-")
            oDate2 = new Date(aDate[1] + '-' + aDate[2] + '-' + aDate[0])
            iDays = parseInt(Math.abs(oDate1 - oDate2) / 1000 / 60 / 60 / 24) //把相差的毫秒数转换为天数
            return iDays
        }

    </script>
    <!-- end sp-wrapper -->
    <script>
        layui.use(['laydate', 'layer','form'], function () {
            var laydate = layui.laydate;
            var layer = layui.layer;
            var form = layui.form;

            laydate.render({
                elem: '#startTime'
            });
            laydate.render({
                elem: '#endTime'
            });

        });
    </script>
</div>
</body>
<html>
